#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include <stdio.h>
#include <string.h>
#include "nvs_flash.h"
#include "../components/uart_callback.c"
#include "../components/adc_read.c"


void app_main(void)
{      
    esp_err_t ret;
    ret = nvs_flash_init();         /* 初始化NVS */
    
    if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND)
    {
        ESP_ERROR_CHECK(nvs_flash_erase());
        ESP_ERROR_CHECK(nvs_flash_init());
    }

    xTaskCreate(uart_callback, "uart_callback", 100, NULL, 10, NULL);
    xTaskCreate(adc_read, "adc_read", 4096, NULL, 10, NULL);

}